<!-- 考勤统计 -->
<template>
  <a-card :bordered="false">
    <a-form layout="inline" @keyup.enter.native="searchQuery">
      <a-form-item label="姓名">
        <j-select-user-by-dep v-model="queryParam.acctid"></j-select-user-by-dep>
      </a-form-item>
      <a-form-item>
        <a-button type="primary" icon="search" @click="searchQuery">查询</a-button>
      </a-form-item>
    </a-form>
    <vxe-grid
      id="SalaryUser"
      ref="vxeTable"
      v-bind="options"
      :columns="columns"
      :data="dataSource"
      @toolbar-button-click="toolbarButtonClickEvent"
      @checkbox-change="onSelectChange"
      @checkbox-all="onSelectChange"
    >
      <template v-slot:toolbar_buttons>
        <a-button type="primary" icon="plus" style="margin:0px 8px 0px 0px;" @click="handleAdd">新增</a-button>
        <a-dropdown v-if="selectedRowKeys.length > 0">
          <a-menu slot="overlay">
            <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
          </a-menu>
          <a-button>批量操作<a-icon type="down" /></a-button>
        </a-dropdown>
      </template>
      <template #operate="{ row }">
        <template>
          <a @click="handleEdit(row)">编辑</a>
          <a-divider type="vertical" />
          <a @click="handleDelete(row)">删除</a>
        </template>
      </template>
      <template v-slot:pager>
        <vxe-pager
          :layouts="['Sizes', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
          :current-page.sync="ipagination.currentPage"
          :page-size.sync="ipagination.pageSize"
          :total="ipagination.total"
          @page-change="handlePageChange"
        >
        </vxe-pager>
      </template>
    </vxe-grid>
    <salary-user-modal ref="modalForm" @ok="modalFormOk" />
  </a-card>
</template>
<script >
import SalaryUserModal from './modal/SalaryUserModal'
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
import { VxeTableMixin } from '@/mixins/VxeTableMixin'
export default {
  name: 'SalaryUser',
  mixins: [VxeTableMixin],
  components: {
    JSelectUserByDep,
    SalaryUserModal
  },
  data() {
    return {
      columns: [
        { type: 'checkbox', width: 50 },
        { type: 'seq', width: 60 },
        { field: 'username', title: '姓名' },
        { field: 'salaryTemplateCode', title: '薪资方案' },
        { field: 'executeDate', title: '执行日期' },
        { field: 'entryDate', title: '入职日期' },
        { field: 'confirmationDate', title: '转正日期' },
        { field: 'departureDate', title: '离职日期' },
        { title: '操作', width: 120, slots: { default: 'operate' }}
      ],
      url: {
        list: '/hr/salary/personnel/list',
        delete: '/hr/salary/personnel/delete',
        deleteBatch: '/hr/salary/personnel/deleteBatch'
      }
    }
  },
  methods: {

  }
}
</script>
